<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"
           %><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"
           %><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"
           %>
<%@ taglib uri="http://displaytag.sf.net" prefix="display" %>
<%@ page contentType="text/html;charset=ISO-8859-1"
         %><html:html>
    <head>
        <title><bean:message key="VUsuarios.title"/></title>
        <html:base/>
        <%@include file="../header/include.jsp" %>
    </head>
    <body>
        <div id="header"  class="ui-widget-header ui-corner-all">
            <h1><bean:message key="all.title"/></h1>
            <div id="menu">
                <%--   <ul id="nav">
                       <li><html:link action="/APreHome.do"><bean:message key="VUsuarios.label1"/></html:link></li>
                       <%if(CohesionActor.checkActor(request, CohesionActor.ACTOR_administrador)) { %>
                       <li><html:link action="/APreCrearUsuario.do"><bean:message key="VUsuarios.label2"/></html:link></li>
                       <% } %>

                </ul>--%>
            </div>
        </div>
        <div id="body_wrapper">
            <div id="body">
                <div id="split">
                    <div class="top"></div>
                    <div id="left">
                        <div id="content">
                            ${empty msg ? "" : msg}
                            <div class="fg-toolbar ui-widget-header ui-corner-top">

                                <h1>Usuarios</h1>
                            </div>

                                         <script>

                                function eliminarUsuario(id) {
                                    $( "#dialog-confirm" ).dialog({
                                        resizable: false,

                                        height:140,
                                        modal: true,
                                        buttons: {
                                            "Borrar": function() {
                                                var url = "<html:rewrite action="AEliminarUsuario.do" />?idUsuario="+id;
                                                $(location).attr('href',url);
                                            },
                                            Cancelar: function() {
                                                $( this ).dialog( "close" );
                                            }
                                        }
                                    });
                                }
                            </script>


                            <div id="dialog-confirm" title="Eliminar" style="display: none;">
                                <p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Se eliminar&aacute; este elemento. Est&aacute; seguro?</p>
                            </div>

                            <div  class="ui-widget-content ui-widget">
                                <div style="float: right;margin: 1% 1% 1% 1%; clear: left;">
                                    <ul class="sf_admin_td_actions fg-buttonset fg-buttonset-single">
                                        <li class="sf_admin_action_usuario"><html:link action="/APreCrearUsuario.do" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-plus"></span>Nuevo Usuario</html:link></li>
                                    </ul>
                                </div>

                                <div class="list ui-grid-table ui-widget ui-corner-all ui-helper-reset ui-helper-clearfix">
                                    <display:table name="L_Personal" requestURI="/APreUsuarios.do" pagesize="10"  class="display-tag-usuario" htmlId="display-tag-usuario" id="usuario">
                                        <display:column property="personalUsuario.alias" title="Alias" sortable="true"/>
                                        <display:column property="nombre" title="Nombre" sortable="true"/>
                                        <display:column property="apellido" title="Apellido" sortable="true" />
                                        
                                        <display:column title="Acciones">

                                            <ul class="sf_admin_td_actions fg-buttonset fg-buttonset-single">
                                                <li class="sf_admin_action_show"><html:link action="/APreUsuario.do" paramId="idUsuario" paramName="usuario" paramProperty="idPersonal" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-document"></span>Mostrar</html:link></li>
                                                <li class="sf_admin_action_edit"><html:link action="/APreEditarUsuario.do" paramId="idUsuario" paramName="usuario" paramProperty="idPersonal" styleClass="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-document"></span>Editar</html:link></li>
                                                <li class="sf_admin_action_delete"><a  href="" onclick="eliminarUsuario(<bean:write name="usuario" property="idPersonal"/>);return false;" class="fg-button-mini fg-button ui-state-default fg-button-icon-left"><span class="ui-icon ui-icon-trash"></span>Eliminar</a></li>
                                            </ul>

                                        </display:column>

                                    </display:table>

                                    <script>
                                        $(document).ready(function() {

                                            $('table#display-tag-usuario thead').addClass('ui-widget-header');
                                            $('table#display-tag-usuario thead tr th').addClass('ui-state-default ui-th-column');
                                            $('table#display-tag-usuario tbody tr').addClass('sf_admin_row ui-widget-content odd');



                                        });
                                    </script>

                                </div>
                            </div>
                        </div>
                        <div id="right">
                            <%@include file="../administrador/VMenuAdmin.jsp" %>



                        </div>
                    <div class="clearer ui-helper-clearfix"></div>
                        <div class="bottom"></div>
                    </div>
                    <div class="clearer"></div>
                </div>
                <div class="clearer"></div>
            </div>
            <div id="end_body"></div>
<div id="footer"> <%@include file="/footer/include.jsp" %> </div>
        </div>
    </body>
</html:html>